package lamnhungoc.controller;

import java.util.List;

import lamnhungoc.pojo.Sach;
import lamnhungoc.service.SachService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class DanhSachBanChayController {
	@Autowired
	private SachService sachService;

	@RequestMapping("/Trang-Sach-Ban-Chay")
	public ModelAndView getAllBookList(){
		ModelAndView mav = new ModelAndView("Trang-Sach-Ban-Chay");
		List<Sach> sachList = sachService.getBookList();
		mav.addObject("BOOKS_RESULTS_KEY",sachList);
		return mav;
	}
}
